package com.ruoyi.dingtalk.model;

import cn.hutool.json.JSONUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.List;
import java.util.stream.Collectors;

@EqualsAndHashCode(callSuper = true)
@Data
@ToString
public class BaseListResponse extends BaseModel {

    private List<String> result;

    public   <V> List<V> getResult(Class<V> clazz){
        return result.stream().map(data-> JSONUtil.toBean(data,clazz)).collect(Collectors.toList());
    }
}
